package cn.detu.uu;

public class Test1 {
    public static void main(String[] args) {
        //method();
        //method2();
        method3();
    }
    public static void method3(){
        String s = "你是";
        String str = "";

        long start = System.currentTimeMillis();
        for(int i=0;i<10000;i++){
            str.concat("s");
        }
        long end = System.currentTimeMillis();
        // System.out.print(str);
         System.out.print(s);
         System.out.print(end-start);
    }
    /*
    public static void method2(){
        String s = "你是";
        String str = "";
        StringBuilder sb = new StringBuilder();
        long start = System.currentTimeMillis();
        for(int i=0;i<10000;i++){
           sb.append(s);
        }
        long end = System.currentTimeMillis();
        // System.out.print(str);
        // System.out.print(sb);
        System.out.print(end-start);
    }
    */

   /* public static void method() {
        String s = "你是hgjhgjhgjhgjhgjhgjhgg";
        String str = "";
        long start = System.currentTimeMillis();
        for(int i=0;i<10000;i++){
            //str= s.concat("逗比");
            str +=s;
            //str=str+s;
        }
        long end = System.currentTimeMillis();
       // System.out.print(str);
        System.out.print(end-start);
    }*/
}
